<?php

class Con_mobile extends Acan{
	
	public $defaultAct='index';
	public $Conread = '首页';
	public $Actread = array('index'=>'首页');
	function __construct($ainfo=null){
		parent::__construct($ainfo=null);
		$this->_S = Afun_session();
	}
	function Act_abody(){
		$anav_data = Afunc_nav()->anav_data('weibo',$this->Amode,$this->Aapp);//获取菜单
		if($this->Amode == '0'){$if_start = $this->Aapp.'-';}else{$if_start='';}
		$default_url = $if_start.'admin-index';
		include $this->Atpl('public/abody_mobile');
	}
	function Act_index(){
		include $this->Atpl();
	}
	function Act_home(){
		$bazi = Afun_new("fate")->bazi("1988-07-25 13:00:00");
		$wuxing = Afun_new("fate")->wuxing($bazi['arr']);
		print_r( $bazi);
		print_r( $wuxing);
		exit;
		include $this->Atpl();
	}
	function Act_login(){
		$this->_S = Afun_session();
		$Auser_json = Ajson_encode($this->_S);
	}
	function Act_reg(){
		$this->_S = Afun_session();
		$Auser_json = Ajson_encode($this->_S);
	}
	function Act_info(){
		if(empty($this->_S['uid'])){
			return Afun_refresh('',$this->Amodr."-login");
		}
		$mfate = Afun_db()->model(Acan_table_fate);
		$muserinfo = Afun_db()->model(Acan_table_weibo_userinfo);
		$oid = $this->_S['oid'];
		$data = $muserinfo->ofind("oid=$oid");
		if($data->birthday_date == "0000-00-00 00:00:00"){
			$data->birthday_date = '';
		}elseif(!empty($data->birthday_date)){
			$data->birthday_date = date("Y年m月d日 H时",strtotime($data->birthday_date));
		}
		include $this->Atpl();
	}
	//认证成功回调
	function Act_auth_call(){
		$code_url = Afun_new('weibo')->auth();
		$this->_S = Afun_session();
		$Auser_json = Ajson_encode($this->_S);
		include $this->Atpl();
	}
	function Act_js(){
		
		include $this->Atpl();
	}
	function Act_wfinfo(){
		$obj->zodiac = Afunc_enum()->data("zodiac");
		$obj->xingzuo = Afunc_enum()->data('constellation');
		$obj->wuxing = array('木','火','土','金','水');
		//生肖配表 大吉1 不能2
		$obj->sxfate = array(
				"1"=>array(2=>1,5=>1,9=>1,4=>2,7=>2,8=>2,10=>2),
				"2"=>array(1=>1,6=>1,10=>1,4=>2,5=>2,7=>2,8=>2,11=>2),
				"3"=>array(7=>1,11=>1,6=>2,9=>2),
				"4"=>array(8=>1,11=>1,12=>1,1=>2,2=>2,5=>2,7=>2,10=>2),
				"5"=>array(1=>1,9=>1,10=>1,2=>2,4=>2,5=>2,11=>2),
				"6"=>array(2=>1,10=>1,3=>2,9=>2,12=>2),
				"7"=>array(3=>1,8=>1,11=>1,1=>2,2=>2,4=>2,7=>2),
				"8"=>array(4=>1,7=>1,12=>1,1=>2,2=>2,11=>2),
				"9"=>array(1=>1,5=>1,3=>2,6=>2,12=>2),
				"10"=>array(2=>1,5=>1,6=>1,4=>2,10=>2,11=>2),
				"11"=>array(3=>1,4=>1,7=>1,2=>2,5=>2,8=>2,10=>2),
				"12"=>array(4=>1,8=>1,6=>2,9=>2,12=>2)
			);
		//星座指数
		$obj->xzfate = array(
			"1_1" =>90,	"2_1" =>75,	"3_1" =>82,	"4_1" =>47,	"5_1" =>94,	"6_1" =>65,	"7_1" =>85,	"8_1" =>70,	"9_1" =>99,	"10_1" =>58,"11_1" =>88,"12_1" =>79,
			"1_2" =>68,	"2_2" =>88,	"3_2" =>72,	"4_2" =>75,	"5_2" =>45,	"6_2" =>97,	"7_2" =>57,	"8_2" =>78,	"9_2" =>61,	"10_2" =>93,"11_2" =>66,"12_2" =>81,
			"1_3" =>79,	"2_3" =>76,	"3_3" =>89,	"4_3" =>71,	"5_3" =>81,	"6_3" =>57,	"7_3" =>93,	"8_3" =>69,	"9_3" =>86,	"10_3" =>64,"11_3" =>99,"12_3" =>48,
			"1_4" =>52,	"2_4" =>82,	"3_4" =>78,	"4_4" =>89,	"5_4" =>61,	"6_4" =>84,	"7_4" =>66,	"8_4" =>92,	"9_4" =>70,	"10_4" =>87,"11_4" =>74,"12_4" =>97,
			"1_5" =>97,	"2_5" =>56,	"3_5" =>79,	"4_5" =>69,	"5_5" =>87,	"6_5" =>72,	"7_5" =>81,	"8_5" =>45,	"9_5" =>92,	"10_5" =>77,"11_5" =>84,"12_5" =>62,
			"1_6" =>61,	"2_6" =>91,	"3_6" =>76,	"4_6" =>88,	"5_6" =>66,	"6_6" =>89,	"7_6" =>49,	"8_6" =>81,	"9_6" =>72,	"10_6" =>95,"11_6" =>55,"12_6" =>84,
			"1_7" =>85,	"2_7" =>74,	"3_7" =>98,	"4_7" =>58,	"5_7" =>88,	"6_7" =>77,	"7_7" =>90,	"8_7" =>71,	"9_7" =>80,	"10_7" =>47,"11_7" =>95,"12_7" =>64,
			"1_8" =>60,	"2_8" =>80,	"3_8" =>68,	"4_8" =>97,	"5_8" =>65,	"6_8" =>84,	"7_8" =>73,	"8_8" =>87,	"9_8" =>47,	"10_8" =>76,"11_8" =>57,"12_8" =>92,
			"1_9" =>92,	"2_9" =>70,	"3_9" =>81,	"4_9" =>65,	"5_9" =>98,	"6_9" =>58,	"7_9" =>86,	"8_9" =>68,	"9_9" =>89,	"10_9" =>75,"11_9" =>78,"12_9" =>44,
			"1_10"=>43,	"2_10"=>97,	"3_10"=>70,	"4_10"=>80,	"5_10"=>59,	"6_10"=>92,	"7_10"=>51,	"8_10"=>85,	"9_10"=>64,	"10_10"=>88,"11_10"=>74,"12_10"=>77,
			"1_11"=>72,	"2_11"=>41,	"3_11"=>91,	"4_11"=>58,	"5_11"=>78,	"6_11"=>64,	"7_11"=>96,	"8_11"=>51,	"9_11"=>82,	"10_11"=>69,"11_11"=>87,"12_11"=>60,
			"1_12"=>71,	"2_12"=>78,	"3_12"=>46,	"4_12"=>93,	"5_12"=>61,	"6_12"=>65,	"7_12"=>74,	"8_12"=>99,	"9_12"=>54,	"10_12"=>82,"11_12"=>69,"12_12"=>88,
		);
		//生肖配表 大吉1 不能2
		Afun_json($obj);
	}
	function Act_ready(){
		$Auser_json = Ajson_encode($this->_S);
		$muser = Afun_db()->model(Acan_table_weibo_user);
		$muserinfo = Afun_db()->model(Acan_table_weibo_userinfo);
		$oid = $this->_S['oid'];
		$data = $muserinfo->ofind("oid=$oid");
		if($data->birthday_date == "0000-00-00 00:00:00"){
			$data->birthday_date = '';
		}elseif(!empty($data->birthday_date)){
			$data->birthday_date = date("Y年m月d日 H时",strtotime($data->birthday_date));
		}
		include $this->Atpl();
	}
}

?>